3.454 \(\int \frac {\cos ^3(c+d x)}{a+b \tan ^2(c+d x)} \, dx\)

Optimal. Leaf size=88 \[ \frac {b^2 \tanh ^{-1}\left (\frac {\sqrt {a-b} \sin (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} d (a-b)^{5/2}}-\frac {\sin ^3(c+d x)}{3 d (a-b)}+\frac {(a-2 b) \sin (c+d x)}{d (a-b)^2} \]

[Out]

(a-2*b)*sin(d*x+c)/(a-b)^2/d-1/3*sin(d*x+c)^3/(a-b)/d+b^2*arctanh(sin(d*x+c)*(a-b)^(1/2)/a^(1/2))/(a-b)^(5/2)/
d/a^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.12, antiderivative size = 88, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3676, 390, 208} \[ \frac {b^2 \tanh ^{-1}\left (\frac {\sqrt {a-b} \sin (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} d (a-b)^{5/2}}-\frac {\sin ^3(c+d x)}{3 d (a-b)}+\frac {(a-2 b) \sin (c+d x)}{d (a-b)^2} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^3/(a + b*Tan[c + d*x]^2),x]

[Out]

(b^2*ArcTanh[(Sqrt[a - b]*Sin[c + d*x])/Sqrt[a]])/(Sqrt[a]*(a - b)^(5/2)*d) + ((a - 2*b)*Sin[c + d*x])/((a - b
)^2*d) - Sin[c + d*x]^3/(3*(a - b)*d)

Rule 208

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-(a/b), 2]*ArcTanh[x/Rt[-(a/b), 2]])/a, x] /; FreeQ[{a,
b}, x] && NegQ[a/b]

Rule 390

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Int[PolynomialDivide[(a + b*x^n)
^p, (c + d*x^n)^(-q), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && IGtQ[p, 0] && ILt
Q[q, 0] && GeQ[p, -q]

Rule 3676

Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^(n_))^(p_.), x_Symbol] :> With[{ff = F
reeFactors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[ExpandToSum[b*(ff*x)^n + a*(1 - ff^2*x^2)^(n/2), x]^p/(1 -
ff^2*x^2)^((m + n*p + 1)/2), x], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n/2] && IntegerQ[p]

Rubi steps

\begin {align*} \int \frac {\cos ^3(c+d x)}{a+b \tan ^2(c+d x)} \, dx &=\frac {\operatorname {Subst}\left (\int \frac {\left (1-x^2\right )^2}{a-(a-b) x^2} \, dx,x,\sin (c+d x)\right )}{d}\\ &=\frac {\operatorname {Subst}\left (\int \left (\frac {a-2 b}{(a-b)^2}-\frac {x^2}{a-b}+\frac {b^2}{(a-b)^2 \left (a-(a-b) x^2\right )}\right ) \, dx,x,\sin (c+d x)\right )}{d}\\ &=\frac {(a-2 b) \sin (c+d x)}{(a-b)^2 d}-\frac {\sin ^3(c+d x)}{3 (a-b) d}+\frac {b^2 \operatorname {Subst}\left (\int \frac {1}{a-(a-b) x^2} \, dx,x,\sin (c+d x)\right )}{(a-b)^2 d}\\ &=\frac {b^2 \tanh ^{-1}\left (\frac {\sqrt {a-b} \sin (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} (a-b)^{5/2} d}+\frac {(a-2 b) \sin (c+d x)}{(a-b)^2 d}-\frac {\sin ^3(c+d x)}{3 (a-b) d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.51, size = 115, normalized size = 1.31 \[ \frac {\frac {6 b^2 \left (\log \left (\sqrt {a-b} \sin (c+d x)+\sqrt {a}\right )-\log \left (\sqrt {a}-\sqrt {a-b} \sin (c+d x)\right )\right )}{\sqrt {a} (a-b)^{5/2}}+\frac {3 (3 a-7 b) \sin (c+d x)}{(a-b)^2}+\frac {\sin (3 (c+d x))}{a-b}}{12 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^3/(a + b*Tan[c + d*x]^2),x]

[Out]

((6*b^2*(-Log[Sqrt[a] - Sqrt[a - b]*Sin[c + d*x]] + Log[Sqrt[a] + Sqrt[a - b]*Sin[c + d*x]]))/(Sqrt[a]*(a - b)
^(5/2)) + (3*(3*a - 7*b)*Sin[c + d*x])/(a - b)^2 + Sin[3*(c + d*x)]/(a - b))/(12*d)

________________________________________________________________________________________

fricas [A]  time = 0.50, size = 276, normalized size = 3.14 \[ \left [\frac {3 \, \sqrt {a^{2} - a b} b^{2} \log \left (-\frac {{\left (a - b\right )} \cos \left (d x + c\right )^{2} - 2 \, \sqrt {a^{2} - a b} \sin \left (d x + c\right ) - 2 \, a + b}{{\left (a - b\right )} \cos \left (d x + c\right )^{2} + b}\right ) + 2 \, {\left (2 \, a^{3} - 7 \, a^{2} b + 5 \, a b^{2} + {\left (a^{3} - 2 \, a^{2} b + a b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{6 \, {\left (a^{4} - 3 \, a^{3} b + 3 \, a^{2} b^{2} - a b^{3}\right )} d}, -\frac {3 \, \sqrt {-a^{2} + a b} b^{2} \arctan \left (\frac {\sqrt {-a^{2} + a b} \sin \left (d x + c\right )}{a}\right ) - {\left (2 \, a^{3} - 7 \, a^{2} b + 5 \, a b^{2} + {\left (a^{3} - 2 \, a^{2} b + a b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{3 \, {\left (a^{4} - 3 \, a^{3} b + 3 \, a^{2} b^{2} - a b^{3}\right )} d}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^3/(a+b*tan(d*x+c)^2),x, algorithm="fricas")

[Out]

[1/6*(3*sqrt(a^2 - a*b)*b^2*log(-((a - b)*cos(d*x + c)^2 - 2*sqrt(a^2 - a*b)*sin(d*x + c) - 2*a + b)/((a - b)*
cos(d*x + c)^2 + b)) + 2*(2*a^3 - 7*a^2*b + 5*a*b^2 + (a^3 - 2*a^2*b + a*b^2)*cos(d*x + c)^2)*sin(d*x + c))/((
a^4 - 3*a^3*b + 3*a^2*b^2 - a*b^3)*d), -1/3*(3*sqrt(-a^2 + a*b)*b^2*arctan(sqrt(-a^2 + a*b)*sin(d*x + c)/a) -
(2*a^3 - 7*a^2*b + 5*a*b^2 + (a^3 - 2*a^2*b + a*b^2)*cos(d*x + c)^2)*sin(d*x + c))/((a^4 - 3*a^3*b + 3*a^2*b^2
 - a*b^3)*d)]

________________________________________________________________________________________

giac [B]  time = 1.54, size = 161, normalized size = 1.83 \[ \frac {\frac {3 \, b^{2} \arctan \left (-\frac {a \sin \left (d x + c\right ) - b \sin \left (d x + c\right )}{\sqrt {-a^{2} + a b}}\right )}{{\left (a^{2} - 2 \, a b + b^{2}\right )} \sqrt {-a^{2} + a b}} - \frac {a^{2} \sin \left (d x + c\right )^{3} - 2 \, a b \sin \left (d x + c\right )^{3} + b^{2} \sin \left (d x + c\right )^{3} - 3 \, a^{2} \sin \left (d x + c\right ) + 9 \, a b \sin \left (d x + c\right ) - 6 \, b^{2} \sin \left (d x + c\right )}{a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}}}{3 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^3/(a+b*tan(d*x+c)^2),x, algorithm="giac")

[Out]

1/3*(3*b^2*arctan(-(a*sin(d*x + c) - b*sin(d*x + c))/sqrt(-a^2 + a*b))/((a^2 - 2*a*b + b^2)*sqrt(-a^2 + a*b))
- (a^2*sin(d*x + c)^3 - 2*a*b*sin(d*x + c)^3 + b^2*sin(d*x + c)^3 - 3*a^2*sin(d*x + c) + 9*a*b*sin(d*x + c) -
6*b^2*sin(d*x + c))/(a^3 - 3*a^2*b + 3*a*b^2 - b^3))/d

________________________________________________________________________________________

maple [A]  time = 0.80, size = 98, normalized size = 1.11 \[ \frac {-\frac {\frac {a \left (\sin ^{3}\left (d x +c \right )\right )}{3}-\frac {b \left (\sin ^{3}\left (d x +c \right )\right )}{3}-a \sin \left (d x +c \right )+2 b \sin \left (d x +c \right )}{\left (a -b \right )^{2}}+\frac {b^{2} \arctanh \left (\frac {\left (a -b \right ) \sin \left (d x +c \right )}{\sqrt {a \left (a -b \right )}}\right )}{\left (a -b \right )^{2} \sqrt {a \left (a -b \right )}}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^3/(a+b*tan(d*x+c)^2),x)

[Out]

1/d*(-1/(a-b)^2*(1/3*a*sin(d*x+c)^3-1/3*b*sin(d*x+c)^3-a*sin(d*x+c)+2*b*sin(d*x+c))+b^2/(a-b)^2/(a*(a-b))^(1/2
)*arctanh((a-b)*sin(d*x+c)/(a*(a-b))^(1/2)))

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^3/(a+b*tan(d*x+c)^2),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(b-a>0)', see `assume?` for mor
e details)Is b-a positive or negative?

________________________________________________________________________________________

mupad [B]  time = 15.44, size = 251, normalized size = 2.85 \[ \frac {\frac {2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a-2\,b\right )}{a^2-2\,a\,b+b^2}+\frac {4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (a-4\,b\right )}{3\,\left (a^2-2\,a\,b+b^2\right )}+\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (a-2\,b\right )}{a^2-2\,a\,b+b^2}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-\frac {b^2\,\mathrm {atan}\left (\frac {2{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3-6{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b+6{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b^2-2{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^3}{\sqrt {a}\,{\left (a-b\right )}^{5/2}\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}\right )\,1{}\mathrm {i}}{\sqrt {a}\,d\,{\left (a-b\right )}^{5/2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)^3/(a + b*tan(c + d*x)^2),x)

[Out]

((2*tan(c/2 + (d*x)/2)*(a - 2*b))/(a^2 - 2*a*b + b^2) + (4*tan(c/2 + (d*x)/2)^3*(a - 4*b))/(3*(a^2 - 2*a*b + b
^2)) + (2*tan(c/2 + (d*x)/2)^5*(a - 2*b))/(a^2 - 2*a*b + b^2))/(d*(3*tan(c/2 + (d*x)/2)^2 + 3*tan(c/2 + (d*x)/
2)^4 + tan(c/2 + (d*x)/2)^6 + 1)) - (b^2*atan((a^3*tan(c/2 + (d*x)/2)*2i - b^3*tan(c/2 + (d*x)/2)*2i + a*b^2*t
an(c/2 + (d*x)/2)*6i - a^2*b*tan(c/2 + (d*x)/2)*6i)/(a^(1/2)*(a - b)^(5/2)*(tan(c/2 + (d*x)/2)^2 + 1)))*1i)/(a
^(1/2)*d*(a - b)^(5/2))

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**3/(a+b*tan(d*x+c)**2),x)

[Out]

Timed out

________________________________________________________________________________________